home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Ham Radio 2000
/
Ham Radio 2000.iso
/
ham2000
/
misc
/
dbrain
/
brain.asm
< prev
next >
Wrap
Assembly Source File
|
1995-07-14
|
25KB
|
1,033 lines
*--------------------------------------------
* 68HC05 Version. -
* Craswell Variable Frequency Osc -
* Using the Harris 45102 NCO. -
*--------------------------------------------
* Dover Research Corporation -
* November 2nd 1993, June 30th 1995 -
* All rights reserved -
* -
* Author: James J. Craswell WB0VNE/AAV5TH -
* Part of a commercial product so this code -
* Is NOT Public Domain -
* (612) 492-3913 -
*--------------------------------------------
* 1.0 Nano processor Harris controler. -
* -
* BUGS: None?! (a tiny voice says "yet") -
*--------------------------------------------
* THE ETHIC -
* Promote free exchange of information. -
* Mistrust Authority. -
* Promote Decentralization. -
* Programers should be judged by their work -
* not bogus criteria such as degrees, age, -
* race or position. -
* You can create art, beauty and complete -
* and total crap on a computer. -
* Computers can change / screw up your life.-
*--------------------------------------------
* W A T C H O U T A S I M O ! -
*--------------------------------------------
org $00c0 ;Start of user ram.
*****************************
* Ram locations for different
* routines.
*****************************
vfo4 db 0 ;Always valid current VFO frequency.
vfo3 db 0
vfo2 db 0
vfo1 db 0
scr4 db 0 ;Scratch vfo used for math and shifting.
scr3 db 0
scr2 db 0
scr1 db 0
math4 db 0 ;msb for math routines and up/dn steps.
math3 db 0 ;As well as display routines
math2 db 0 ;and other neato stuff.
math1 db 0 ;lsb.
mathb4 db 0 ;Scratch math area.
mathb3 db 0
mathb2 db 0
mathb1 db 0
first db 0 ;Most receint read on the opto switch.
ans db 0 ;Answer to dds divide.
tempa db 0 ;Place to save a register.
tempx db 0 ;Place to save x regester.
***************
* LCD MESSAGES:
***************
mfreq db ' '
mstep db ' '
***************
* CURRENT STEP:
***************
cstep db 0 ; 0-1hz, 1-10hz, 2-100hz
; 3-1KHz, 4-10KHz, 5-100Khz
***************************
* Zero VFO frequeny in hex.
***************************
t4 equ 20h ;msb of test vfo.
t3 equ 51h ;
t2 equ 0ebh ;
t1 equ 85h ;lsb of 5.05MHz.
**********************
* HARRIS DDS Commands.
**********************
idle equ 0b4h ;This cmd sets the Harris DDS to the Idle state.
xfer equ 0fbh ;Clk to Harris DDS.
dat1 equ 0b6h ;Data bit = 1.
clk equ 1 ;Clock bit is the 1 bit.
lcnt equ 1fh ;Length of all Harris DDS commands.
*********************************
* Frequencies in Harris DDS talk.
*********************************
h1-4 equ 0 ;1hertz steps.
h1-3 equ 0
h1-2 equ 0
h1-1 equ 6ch
h10-4 equ 0 ;10hz.
h10-3 equ 0
h10-2 equ 4h
h10-1 equ 32h
h100-4 equ 0 ;100hz.
h100-3 equ 0
h100-2 equ 29h
h100-1 equ 0f2h
k1-4 equ 0 ;1Khz.
k1-3 equ 1h
k1-2 equ 0a3h
k1-1 equ 6fh
k10-4 equ 0 ;10Khz.
k10-3 equ 10h
k10-2 equ 62h
k10-1 equ 4eh
k100-4 equ 0 ;100Khz.
k100-3 equ 0a3h
k100-2 equ 0d7h
k100-1 equ 0bh
mhz-4 equ 06h ;1Mhz.
mhz-3 equ 66h
mhz-2 equ 66h
mhz-1 equ 67h
mhz10-4 equ 40h ;10 Mhz
mhz10-3 equ 00h
mhz10-2 equ 00h
mhz10-1 equ 00h
********************************************************************
org $0300 ;Start of 68HC705j1A EPROM.
**********************************
* Initialize all one time options.
**********************************
start: lda #2 ;Step = 100hz.
sta cstep ;Load current step.
lda #$ff ;Set direction bits for PA0~7.
sta ddra ;make pins PA7-PA0 outputs.
lda #$30 ;Set direction bits for PA0~5.
sta ddrb ;Set PA5,4 to output rest to read.
***************************
* Load LCD messages to ram:
***************************
clrx ;clear count/position.
idis: cpx #1eh ;Done printing?
bhs eids ;Branch is count is equal or higher.
lda stdis,x ;Load next character.
sta mfreq,x ;temporarly store accumulator.
incx ;Increment count.
jmp idis ;Jump to load char.
eids: clrx ;End this routine by falling out.
**********************************
* Clear clock lines to data ports.
**********************************
bclr 5,portb ;Set DDS Data clk to zero.
bclr 4,portb ;Set LCD Data clk to zero.
bclr 3,portb ;Set Control Register to zero.
lda portb ;Read initial settings of vfo dial.
and #3 ;Isolate bottom 2 bits (VFO bits.)
sta first ;Save result.
jsr hz100 ;Load up/dn with 100hz value.
jsr m2mb ;Save it in non-scratch locations.
**********************
* Initilize Lcd panel:
**********************
lda #3h ;Warm up cold lcd cmd.
jsr inst ;Not sure we have to do this
jsr dly50 ;Long delay.
jsr inst ;As no "real" code does it but...
jsr dly50 ;It is in the spec.
jsr inst ;Inst is to cmd reg of lcd.
jsr dly50 ;More long delays.
lda #2h ;Set it to 4bit data bus 2 line lcd.
jsr inst ;4 bit means one nibble at a time to
jsr dly50 ;send each byte.
jsr inst
jsr dly50
lda #8h
jsr inst
jsr dly50
lda #0h ;Clear the display and
jsr inst ;Home the cursor.
jsr dly50
lda #1h
jsr inst
jsr dly50
*******************************
* LCD DISPLAY:
* -----------------------------
* 0 0 0 0 0 0 1 x x x
* : : :
* : : Blink 1=on
* : Cursor 0=off
* Display 1=on
********************************
lda #0h ;First nibble display cmd.
jsr inst ;Send 1st nibble.
jsr dly50 ;Long delays for initial commands
lda #0Ch ;Display on cursor/blink off.
jsr inst ;Send 2nd nibble.
jsr dly50 ;Long delay for initial commands.
jsr zero ;Set to zero and signal DDS.
jsr dfreq ;Display the current frequency.
jsr dstep ;Display the current freq step.
jmp switch ;Jump to read input routine.
********************************************************************
* S U B R O U T I N E S *
********************************************************************
****************************
* INSTRUCTION:
* Use this routine to write
* command to the LCD.
****************************
inst: and #0FH ;Clear control bits to lcd.
jsr wrtlcd ;Write to instruction register of LCD port.
ora #20h ;Clk bit (E) on.
jsr wrtlcd ;Now write that.
and #0FH ;Clk bit (E) off.
jsr wrtlcd ;Write this and data is latched in.
rts ;Return.
****************************
* WRITE DATA:
* Use this routine to write
* to the LCD data register.
****************************
write: ora #40H ;Turn on rs for write cmds.
jsr wrtlcd ;Send to port.
ora #20H ;Clk bit (E) on.
jsr wrtlcd ;Now write that.
and #4FH ;Clk bit (E) off.
jsr wrtlcd ;Write this and data is latched in.
rts ;Return.
********************************
* WRITE TO LCD DATA PORT:
* Take data in accumulator and
* write it to the LCD data port.
********************************
wrtlcd: jsr delay ;Delay before? Do it to be safe.
sta porta ;Write it to data bus.
bset 4,portb ;Set LCD clk high (data is latched.)
bclr 4,portb ;Set LCB clk to low.
jsr delay ;Delay between writes to make LCD happy.
rts ;Return.
********************************
* WRITE TO HARRIS DATA PORT:
* Take data in accumulator and
* write it to the DDS data port.
********************************
wrtdds: sta porta ;write it to data bus.
bset 5,portb ;Set DDS clk high (data is latched.)
bclr 5,portb ;Set DDS clk low.
rts ;Return.
***********************
* HOME LCD TO 1ST LINE:
***********************
home1: lda #8H ;Home to start of first line.
jsr inst ;Write to cmd register.
lda #0H ;Send the second nibble.
jsr inst ;And write it.
rts ;Return.
***********************
* HOME LCD TO 2ND LINE:
***********************
home2: lda #0CH ;Home to start of second line.
jsr inst ;Write to cmd register.
lda #0h ;Load second nibble.
jsr inst ;And write it.
rts ;Return.
******************
* Set VFO to zero.
******************
zero: lda #t4 ;Load "zero" to vfo4~1.
sta vfo4
lda #t3
sta vfo3
lda #t2
sta vfo2
lda #t1
sta vfo1
jsr v2s ;Save vfo4~1 to scratch MSB/LSB also.
ldx #lcnt ;Load count to shift.
jsr shift ;Shift all data out to Harris.
rts ;Return now.
*************************
* Copy VFO4~1 to SCR4~1:
* Actual Freq to scratch.
*************************
v2s: lda vfo4
sta scr4
lda vfo3
sta scr3
lda vfo2
sta scr2
lda vfo1
sta scr1
rts
*************************
* Copy SCR4~1 to VFO4~1:
* Scratch to Actual Freq.
*************************
s2v: lda scr4
sta vfo4
lda scr3
sta vfo3
lda scr2
sta vfo2
lda scr1
sta vfo1
rts
*************************
* Copy Math4~1 to SCR4~1:
* Copy step to scratch.
*************************
m2s: lda math4
sta scr4
lda math3
sta scr3
lda math2
sta scr2
lda math1
sta scr1
rts
***************************
* Copy Math4~1 to Mathb4~1:
***************************
m2mb: lda math4
sta mathb4
lda math3
sta mathb3
lda math2
sta mathb2
lda math1
sta mathb1
rts
***************************
* Copy Mathb4~1 to Math4~1:
***************************
mb2m: lda mathb4
sta math4
lda mathb3
sta math3
lda mathb2
sta math2
lda mathb1
sta math1
rts
*************************************
* STUPID BRCLR won't go ver far so...
*************************************
bmp: jmp bump ;Inbetween step to get to real bump routine.
*************************
* CLICK VFO UP ONE NOTCH.
*************************
up: jsr upurs ;Add one "step" from VFO.
jsr dfreq ;Update display unit.
jmp switch ;Jump back to switch reading routine.
*************************
* CLICK VFO Dn ONE NOTCH.
*************************
dn: jsr dnurs ;Subtract one "step" from VFO.
jsr s2v ;Save it to VFO.
jsr shift ;Need to do the shift also.
jsr dfreq ;Update display unit.
;Fall through to switch routine.
**************************
* READ OPTO SWITCH:
* ACCUM=Scratch
* First=old data from Opto
* X=2nd read of Opto
**************************
switch: brclr 2,portb,bmp ;Jump if VFO pushed in.
lda portb ;Read switch input pins.
and #3 ;Isolate the switch bits.
tax ;Move switch info to X register.
lda first ;Load old switch data from last read.
cmp #3 ;Was first read a 11b?
beq st3 ;Yes? Then jump.
cmp #2 ;Was first read from VFO a 10 binary?
beq st2 ;Yes? Then jump.
cmp #1 ;Was first read a 01b?
beq st1 ;Yes? then jump.
****************************
* Original sw=0.
* By knowing the values
* of two sucsessive reads
* from the VFO Switch we can
* determine what direction
* (if and) the switch is
* being twisted.
****************************
st0: stx first ;Save current read to first reg for next time.
txa ;Move new read into a.
cmp #1 ;Is it an up operation?
beq up ;Jump if so.
cmp #2 ;Is is a dn operation?
beq dn ;Jump if it is.
jmp switch ;And go back to switch routine.
****************
* Original sw=1.
****************
st1: stx first ;Save current read to first reg for next time.
txa ;Move new read into a.
cmp #3 ;Is it an up operation?
beq up ;Jump if so.
cmp #0 ;Is is a dn operation?
beq dn ;Jump if it is.
jmp switch
****************
* Original sw=2.
****************
st2: stx first ;Save current read to first reg for next time.
txa ;Move new read into a.
cmp #0 ;Is it an up operation?
beq up ;Jump if so.
cmp #3 ;Is is a dn operation?
beq dn ;Jump if it is.
jmp switch
****************
* Original sw=3.
****************
st3: stx first ;Save current read to first reg for next time.
txa ;Move new read into a.
cmp #2 ;Is it an up operation?
beq up ;Jump if so.
cmp #1 ;Is is a dn operation?
beq dn ;Jump if it is.
jmp switch
***********************
* DOWN YOURS:
* Decrease output freq.
* A simple 32Bit sub.
* SCR=SCR-MATH
***********************
dnurs: lda scr1 ;Get scr1 of current VFO frequency.
sub math1 ;Add lsbs together without carry.
sta scr1 ;Save result.
lda scr2 ;Get scr2 of current VFO frequency.
sbc math2 ;Add with carry from 1st addition.
sta scr2 ;Save new result.
lda scr3 ;Get scr3 of current VFO frequency.
sbc math3 ;Add with carry from 2nd addition.
sta scr3 ;Save new result.
lda scr4 ;Get scr4 of current VFO frequency.
sbc math4 ;Add with carry from 3rd addition.
sta scr4 ;save last result!
ldx #lcnt ;Load x with amount to shift.
rts ;Return.
***********************
* UP YOURS:
* Increase output freq.
* A simple 32Bit add.
* SCR=SCR+MATH
***********************
upurs: lda scr1 ;Get scr1 of current VFO frequency.
add math1 ;Add lsbs together without carry.
sta scr1 ;Save result.
lda scr2 ;Get scr2 of current VFO frequency.
adc math2 ;Add with carry from 1st addition.
sta scr2 ;Save new result.
lda scr3 ;Get scr3 of current VFO frequency.
adc math3 ;Add with carry from 2nd addition.
sta scr3 ;Save new result.
lda scr4 ;Get scr4 of current VFO frequency.
adc math4 ;Add with carry from 3rd addition.
sta scr4 ;save last result!
ldx #lcnt ;Load amount to shift.
jsr s2v
****************************************
* SHIFT 32 BIT DATA:
* SCR Contains the 32 bit cmd
* that shall be written to the I/O port.
* Shift left shifts the 32 long into
* the HARRIS NCO (or DDS) Chip.
****************************************
shift: lda scr1 ;Load A with LSB of data to shift out.
add scr1 ;Add it to itself (Carry is M.S.Bit)
sta scr1 ;Save new result.
lda scr2 ;Load next byte.
adc scr2 ;add with carry from 1st add.
sta scr2 ;And so on....
lda scr3 ;on
adc scr3 ;and on
sta scr3 ;and
lda scr4 ;on
adc scr4 ;and on
sta scr4 ;and
lda #idle ;on.
bcs da1 ;If carry set we need to send a 1 to dds.
back: jsr wrtdds ;Write to Harris DDS chip.
ora #clk ;Turn on clk bit now.
jsr wrtdds ;Write it (clocking in valid data bit.)
lda #idle ;Load idle command again!
jsr wrtdds ;Write idle to Harris DDS.
decx ;Decrement shift count.
bne shift ;Loop until all 32 data bits are sent.
jmp xferit ;Data send now signal transfer complete.
***************************
* Change data bit to a one.
***************************
da1: lda #dat1 ;Change data bit to a 1 (not zero.)
jmp back ;Keep going. Gotta finish all those bits.
***********************************
* TRANSFER:
* This routine signals the DDS that
* a 32 bit command is complete.
***********************************
xferit: lda #xfer ;Load Idle command.
jsr wrtdds ;Write it to DDS port.
******************
* IDLE Harris DDS.
******************
idleit: lda #idle ;Load Idle again.
jsr wrtdds ;And write it to the DDS port.
jsr v2s ;Restore scratch (shifted) locations.
rts ;Return to caller.
*******************************
* 32 Bit division routine: *
*******************************
* Answer *
* __________ *
* Divisor) Dividend *
* *
*******************************
* Divide two 32 Bit integers. *
* Answer in ans *
* Remainder in MATH(4~1) *
*******************************
div32: clr ans ;Clear answer register.
divb: clrx ;Clear count each time through.
lda scr1 ;Get scr1 of current VFO frequency.
sub math1 ;Add lsbs together without carry.
sta scr1 ;Save result.
lda scr2 ;Get scr2 of current VFO frequency.
sbc math2 ;Add with carry from 1st addition.
sta scr2 ;Save new result.
lda scr3 ;Get scr3 of current VFO frequency.
sbc math3 ;Add with carry from 2nd addition.
sta scr3 ;Save new result.
lda scr4 ;Get scr4 of current VFO frequency.
sbc math4 ;Add with carry from 3rd addition.
sta scr4 ;save last result!
bcs fixit ;Oops divided by one too many!
inc ans ;X = answer.
jmp divb ;Keep on dividing.
***********************
* Add back over divide.
***********************
fixit: lda scr1 ;Get scr1 of current VFO frequency.
add math1 ;Add lsbs together without carry.
sta scr1 ;Save result.
lda scr2 ;Get scr2 of current VFO frequency.
adc math2 ;Add with carry from 1st addition.
sta scr2 ;Save new result.
lda scr3 ;Get scr3 of current VFO frequency.
adc math3 ;Add with carry from 2nd addition.
sta scr3 ;Save new result.
lda scr4 ;Get scr4 of current VFO frequency.
adc math4 ;Add with carry from 3rd addition.
sta scr4 ;save last result!
lda ans ;Get Binary answer.
add #30 ;Convert to ASCII "number."
rts ;Return to caller.
*****************************
* Change the steps to 10 Mhz.
*****************************
mhz10: lda #mhz10-4 ;Load 10 Mhz values.
sta math4
lda #mhz10-3
sta math3
lda #mhz10-2
sta math2
lda #mhz10-1
sta math1
rts
****************************
* Change the steps to 1 MHZ.
****************************
mhz: lda #mhz-4 ;Load 1 MHz values.
sta math4
lda #mhz-3
sta math3
lda #mhz-2
sta math2
lda #mhz-1
sta math1
rts
******************************
* Change the steps to 100 KHz.
******************************
khz100: lda #k100-4 ;Load 100kHz values.
sta math4
lda #k100-3
sta math3
lda #k100-2
sta math2
lda #k100-1
sta math1
rts
*****************************
* Change the steps to 10 KHz.
*****************************
khz10: lda #k10-4 ;Load 10kHz values.
sta math4
lda #k10-3
sta math3
lda #k10-2
sta math2
lda #k10-1
sta math1
rts
****************************
* Change the steps to 1 KHz.
****************************
khz1: lda #k1-4 ;Load 1kHz values.
sta math4
lda #k1-3
sta math3
lda #k1-2
sta math2
lda #k1-1
sta math1
rts
*********************************
* Change the steps to 100 cycles.
*********************************
hz100: lda #h100-4 ;Load 100Hz values.
sta math4
lda #h100-3
sta math3
lda #h100-2
sta math2
lda #h100-1
sta math1
rts
*******************************
* Change the math to 10 cycles.
*******************************
hz10: lda #h10-4 ;Load 10Hz values.
sta math4
lda #h10-3
sta math3
lda #h10-2
sta math2
lda #h10-1
sta math1
rts
*****************************
* Change the math to 1 cycle.
*****************************
hz1: lda #h1-4 ;Load 1Hz values.
sta math4
lda #h1-3
sta math3
lda #h1-2
sta math2
lda #h1-1
sta math1
rts
***************************
* DISPLAY:
* Display current frequency
***************************
dfreq: jsr home1 ;Home to start of line one of LCD.
jsr m2mb ;Save scratch math to mathb.
jsr sbase ;Subtract base freq (5.05MHz typical)
jsr mhz10 ;Load 10Mhz values to math.
jsr div32 ;Returns ascii answer in accumulator.
; sta mfreq+5 ;Rem out for vfo. Use in Signal generator.
jsr mhz ;Load 1MHz values to math.
jsr div32 ;Returns ascii answer in accumulator.
; sta mfreq+6 ;Rem out because we don't want to display mhz.
jsr khz100
jsr div32
sta mfreq+8
jsr khz10
jsr div32
sta mfreq+9
jsr khz1
jsr div32
sta mfreq+0Ah
jsr hz100
jsr div32
sta mfreq+0Ch
jsr hz10
jsr div32
sta mfreq+0DH
jsr hz1
jsr div32
sta mfreq+0EH ;Store in hertz ascii digit.
jsr mb2m ;Restore scratch steps.
clrx ;Clear offset.
*******************************
* Print FREQ:XX.xxx.xxx to LCD.
*******************************
jsr home1 ;put cursor at start of 1st line.
ldchar: cpx #0FH ;Done printing?
bhs efreq ;Branch is count is equal or higher.
lda mfreq,x ;Load next character.
sta tempa ;temporarly store accumulator.
clc ;clear carry bit.
and #0F0H ;use only top nibble.
rora ;Right shift top nibble to bottom.
rora
rora
rora
jsr write ;Else write nibble to LCD panel.
lda tempa ;Reread stored accumulator.
and #0FH ;Clear out the top nibble.
jsr write
incx ;Increment count.
jmp ldchar ;Jump to load char.
efreq: jsr v2s ;Reload scratch from current VFO.
rts ;End this routine and return.
**************************
* SUBTRACT BASE FREQUENCY.
* Subtract the zero freq
* from the scratch regs
* for display purposes.
**************************
sbase: lda #t4 ;Load "zero" to vfo4~1.
sta math4
lda #t3
sta math3
lda #t2
sta math2
lda #t1
sta math1
jsr dnurs ;32Bit subtract.
jsr mb2m ;Restore scratch math.
rts
*****************************
* Store step to mem in ascii.
*****************************
dstep: jsr home2 ;Home to start of second line of LCD panel.
jsr m2mb ;Save scratch math to mathb.
jsr m2s ;Load current step to scratch.
jsr khz100 ;Load 100Khz to math.
jsr div32 ;Now tell us how many are in scratch.
sta mstep+5 ;Shove ASCII ans to display location.
jsr khz10 ;Load 10Khz to math.
jsr div32 ;Now tell us how many are in scratch.
sta mstep+6 ;Shove ASCII asn to display location.
jsr khz1 ;Load 1Khz to math.
jsr div32 ;Now tell us how many are in scratch.
sta mstep+7 ;Shove it into the temp display location.
jsr hz100 ;Load 100hz to math.
jsr div32 ;Now tell us how many are in scratch.
sta mstep+9 ;Shove it into the temp display location.
jsr hz10 ;Load 10hz to math.
jsr div32 ;Now tell us how many are in scratch.
sta mstep+0AH ;Shove it into the temp display location.
jsr hz1 ;Load 1hz to math.
jsr div32 ;Now tell us how many are in scratch.
sta mstep+0BH ;Shove it into the temp display location.
jsr v2s ;Restore scratch.
jsr mb2m ;Restore scratch steps.
clrx ;Clear offset.
****************************
* Print STEP:XXX.XXX to LCD.
****************************
jsr home2 ;Put cursor at start of line #2.
ldc2: cpx #0fH ;Done printing?
bhs efq2 ;Branch is count is equal or higher.
lda mstep,x ;Load next character.
sta tempa ;temporarly store accumulator.
clc ;clear carry bit.
and #0F0H ;use only top nibble.
rora ;Right shift top nibble to bottom.
rora
rora
rora
jsr write ;Else write nibble to LCD panel.
lda tempa ;Reread stored accumulator.
and #0FH ;Clear out the top nibble.
jsr write ;Else write nibble to LCD panel.
incx ;Increment count.
jmp ldc2 ;Jump to load char.
efq2: jsr v2s ;Restore scratch from current VFO.
rts ;End this routine and return.
*******************
* DELAY 1/4 second.
*******************
dly250:
sta tempa
stx tempx
lda #5 ;5 times 50ms!
lp5: jsr dly50 ;use the 50ms loop.
deca
bne lp5
lda tempa
ldx tempx
rts
**************
* DELAY 50 ms.
**************
dly50:
sta tempa ;Save accumulator.
stx tempx ;Save X.
lda #32 ;32=50ms ff=250ms
olp: clrx
ilp: decx
bne ilp
deca
bne olp
lda tempa ;Restore accumulator.
ldx tempx ;Restore X.
rts
*************************
* DELAY:
* Routine to delay 1.5ms.
*************************
delay:
stx tempx ;Save x register.
clrx ;X is used as the inner loop count.
ldx #20H ;Short delay count.
inrlp: decx ;0~ff, FF!fe,...1~0 256 loops.
bne inrlp ;6cyc*256*500ns/cyc=0.768ms
ldx tempx ;Restore x resiter.
rts
**************************
* BUMP TUNING STEPS.
* User has pressed the VFO
* Knob in and this routine
* responds by changing the
* current step.
**************************
bump: sta tempa
lda cstep ;Load current step.
cmp #0 ;If 1hz
beq s10 ;then goto 10hz steps.
cmp #1 ;If 10hz
beq s100 ;then goto 100Hz steps.
cmp #2 ;If 100hz
beq s1k ;then goto 1KHz steps.
cmp #3 ;If 1Khz
beq s10k ;Then go to 10KHz steps.
cmp #4 ;If 10Khz
beq s100k ;then go to 1hz steps.
cmp #5
beq s1
lda tempa
jmp switch
************
* STEP 1 Hz.
************
s1: lda #0
sta cstep
jsr hz1
jsr dstep
jsr dly250
jmp switch
************
* STEP 10Hz.
************
s10: lda #1
sta cstep
jsr hz10
jsr dstep
jsr dly250
jmp switch
*************
* STEP 100Hz.
*************
s100: lda #2
sta cstep
jsr hz100
jsr dstep
jsr dly250
jmp switch
************
* STEP 1KHz.
************
s1k: lda #3
sta cstep
jsr khz1
jsr dstep
jsr dly250
jmp switch
*************
* STEP 10KHz.
*************
s10k: lda #4
sta cstep
jsr khz10
jsr dstep
jsr dly250
jmp switch
**************
* STEP 100KHz.
**************
s100k: lda #5
sta cstep
jsr khz100
jsr dstep
jsr dly250
jmp switch
************
* STEP 1MHz.
************
s1mhz: lda #6
sta cstep
jsr mhz
jsr dstep
jsr dly250
jmp switch
stdis: db 'FREQ:xx.xxx.xxxSTEP:XXX.XXX hz'
last: db ' '
tim_vec:jmp start
int_vec:jmp start
***************
* VECTOR SPACE.
***************
org $7F8 ;Start of Reset/Interrupt vectors.
dw tim_vec ;If timer ints were enabled it would go here.
dw int_vec ;If IRQ was unmasked it would go here.
dw start ;So 6805 knows where to start on pwr up.
dw start ;So 6805 knows where to go on reset.
end ;NUFF SAID!